package com.example.tests;

import static org.hamcrest.Matchers.equalTo;
import static org.junit.Assert.assertThat;
import java.util.Random;
import org.testng.annotations.Test;
import com.example.fw.Folder;
import com.example.utils.ListOf;

public class TestFolderRemoval extends TestBase{
	@Test
	public void testFolderRemoval(){
		ListOf<Folder> oldList = app.getFolderHelper().getFolders();
		Random rnd = new Random();
		int index = rnd.nextInt(oldList.size());
		app.getFolderHelper().deleteFolder(index);
		ListOf<Folder> newList = app.getFolderHelper().getFolders();
	    assertThat(newList, equalTo(oldList.without(index)));
	}
}
